﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ClubVIPPoints
{
    public partial class SetBuyNowTimer : Form
    {
        public SetBuyNowTimer()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void SetBuyNowTimer_Load(object sender, EventArgs e)
        {
            txtBuyNowTimer.Text = Properties.Settings.Default.BuyNowTimer.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if ((Int32.Parse(txtBuyNowTimer.Text) >= 5) && (Int32.Parse(txtBuyNowTimer.Text) <= 60))
            {
                Properties.Settings.Default.BuyNowTimer = Int32.Parse(txtBuyNowTimer.Text);
            }
            else if (Int32.Parse(txtBuyNowTimer.Text) < 5)
            {
                Properties.Settings.Default.BuyNowTimer = 5;
            }
            else if (Int32.Parse(txtBuyNowTimer.Text) > 60)
            {
                Properties.Settings.Default.BuyNowTimer = 60;
            }

            Properties.Settings.Default.Save();
            this.Close();
            
        }
    }
}
